#include "cacheObjectPool.h"

struct Test
{
    Test(int a_ = 0, int b_ = 0)
    {
        a = a_;
        b = b_;
    }

    int a;
    int b;
};


int main()
{
    metadataObjectAllocator<Test> int_obj;
    Test* obj1 = int_obj.New(1,2);

    std::cout << obj1->a << obj1->b << std::endl;

    Test* obj2 = int_obj.New();
    std::cout << obj2->a << obj2->b << std::endl;

    int_obj.Delete(obj1);
    int_obj.Delete(obj2);


    Test* obj3 = int_obj.New(3,4);
    std::cout << obj3->a << obj3->b << std::endl;
    Test* obj4 = int_obj.New();
    std::cout << obj4->a << obj4->b << std::endl;

    Test* obj5 = int_obj.New();

    int_obj.Delete(obj3);
    int_obj.Delete(obj4);

    return 0;
}